package com.example.sneakerappserver.repository;

import com.example.sneakerappserver.pojo.OrderItem;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderItemRepository extends CrudRepository<OrderItem,Long> {

    @Query(value = "SELECT * FROM tb_order_item WHERE order_id=:orderId",nativeQuery = true)
    List<OrderItem> findAllByOrderId(Long orderId);
}
